//
//  UTTaskRecorderHeaderView.swift
//  UniversalTool
//
//  Created by LGB on 2025/3/4.
//

import UIKit

class UTTaskRecorderHeaderView: UITableViewHeaderFooterView {
    
    var reloadData:(() -> Void)?

    override func awakeFromNib() {
        super.awakeFromNib()
        layer.shouldRasterize = true
        layer.rasterizationScale = UIScreen.main.scale
    }
    
    
    @IBAction func goFinshRecord(_ sender: UIButton) {
        let vc = UTTaskCounterRecordViewController()
        vc.modalPresentationStyle = .overFullScreen
        UIApplication.topViewController()?.present(vc, animated: false)
    }
    
    @IBAction func addTask(_ sender: UIButton) {
        let vc = UTAddTaskCounterViewController()
        vc.modalPresentationStyle = .overFullScreen
        UIApplication.topViewController()?.present(vc, animated: false)
        vc.reloadData = {
            if let handler = self.reloadData {
                handler()
            }
        }
    }
    
}
